/**
 *  本地存储操作
 *  @param { name 名称 value 内容}
 * */ 

export function setLocations (name, value){
  return  localStorage.setItem(name, JSON.stringify(value))
}

export function getLocations ( name ) {
  return  JSON.parse(localStorage.getItem (name))
}

// 设置手机号token
export const setPhoneTokenMap = (mapObj) => {
  const phoneTokenMap = getLocations('phoneTokenMap')
  const phoneTokenMapNew = {
    ...phoneTokenMap,
    ...mapObj
  }
  setLocations('phoneTokenMap', phoneTokenMapNew)
}